﻿/*
 * @Author: 姚潘涛
 * @Date: 2024-04-08 20:36:39
 * @LastEditors: 姚潘涛
 * @LastEditTime: 2024-08-30 16:11:12
 * @Description:
 *
 * Copyright (c) 2024 by pandaman, All Rights Reserved.
 */
#pragma once

#ifndef BJ_PROPERTY
#define BJ_PROPERTY(type, name)                                          \
    Q_PROPERTY(type name READ name WRITE set##name NOTIFY name##Changed) \
public:                                                                  \
    void set##name(type temp##name) {                                    \
        if (m_##name == temp##name)                                      \
            return;                                                      \
        m_##name = temp##name;                                           \
        emit name##Changed();                                            \
    }                                                                    \
    type name() {                                                        \
        return m_##name;                                                 \
    }                                                                    \
Q_SIGNALS:                                                               \
    void name##Changed();                                                \
                                                                         \
private:                                                                 \
    type m_##name = 0;

#endif
